<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>会员管理</title>

    <!-- Bootstrap Core CSS -->
    <link href="__PUBLIC__/home/css/bootstrap.min.css" rel="stylesheet">
    <link href="__PUBLIC__/home/css/common.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <!--<link href="_PUBLIC__/font/css/font-awesome.min.css" rel="stylesheet" type="text/css">-->

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link href="__PUBLIC__/home/css/common.css" rel="stylesheet">
</head>

<body>
<div class="container-fluid">
    <form class="form-inline" action="{:U('Member/index')}" method="post">
        <div class="form-group">
            <label for="exampleInputName2">关键字</label>
            <input type="text" style="width: 200px;" class="form-control" id="exampleInputName2"  name="keyword"  value="{:I('post.keyword/s','')}">
        </div>
        <!--<div class="form-group">-->
            <!--<label for="exampleInputName2">结束时间</label>-->
            <!--<input type="text" class="form-control" id="exampleInputName3" name="keyword" readonly value="{:I('post.keyword/s','')}">-->
        <!--</div>-->
        <button type="submit" class="btn btn-default">搜索</button>
        <button type="button" class="btn btn-sm btn-primary btn-close" id="xx-btn-add">添加员工</button>
        <button type="button" class="btn btn-sm btn-default btn-close" id="xx-btn-excel">导出员工</button>
        <button type="button" class="btn btn-sm btn-default btn-close" id="xx-btn-excel-to">导入员工</button>
    </form>


    <div class="row">
        <div class="col-lg-12">
            <h2></h2>
            <div class="">
                <table class="table table-bordered table-hover table-striped" id="dataTables-date">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>员工名称</th>
                        <th>所属店铺</th>
                        <th>所属部门</th>
                        <th>注册时间</th>
                        <th>二维码</th>
                        <th>昨日邀请人数</th>
                        <th>今天邀请人数</th>
                        <th>共邀请人数</th>
                        <th>操作</th>

                    </tr>
                    </thead>
                    <tbody>
                    <volist name="list" key="k" id ="ord">
                        <tr>
                            <td>{$k}</td>
                            <td>{$ord.real_name}</td>
                            <td>{$ord.s_name}</td>
                            <td>{$ord.department_name|default='无'}</td>
                            <td>{$ord.reg_time|date="Y-m-d H:i",###}</td>
                            <td>
                                 <a href="javascript:;" class="btn btn-primary qr_code" data-src="{$ord.image}">查看二维码</a>
                            </td>
                            <td>{$ord.yesterday}</td>
                            <td>{$ord.today}</td>
                            <td>{$ord.total}</td>
                            <td>
                                <a href="{:U('Member/edit',array('son_id'=>$ord['user_id']))}">查看/编辑</a>  |
                                <a href="{:U('Member/excelMember',array('store_id'=>$ord['user_id']))}">导出邀请人</a>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!-- /.row -->
    <div class="pages">
        {$page}
    </div>
</div>



<script src="__PUBLIC__/home/js/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="__PUBLIC__/home/js/bootstrap.min.js"></script>
<script src="Public/home/js/laydate/laydate.js"></script>
<script src="__PUBLIC__/home/js/layer/layer.js"></script>
<!-- iframe自适应高度 -->

</body>
<script type="text/javascript">
    $(".qr_code").click(function(){
        var src = $(this).attr('data-src');
        if(src){
            var str = "<img style='width:250px;height: 250px;margin: 0 auto' src="+src+">";
            layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                area: ['auto'],
                skin: 'layui-layer-nobg', //没有背景色
                shadeClose: true,
                content: str
            });
        }else{
            layer.msg('二维码信息错误');
            return false;
        }

    })

    // laydate.render({
    //     elem: '#exampleInputName2'
    //     ,type: 'datetime'
    //     ,range: true
    // })
    // laydate.render({
    //     elem:"#exampleInputName3"
    // })

    $(".btn-close").click(function () {
        window.parent.$('.bg-model').hide();
    })

    $("#xx-btn-add").click(function () {
        location.href = "{:U('Member/insert')}";
    })
    $("#xx-btn-excel").click(function(){
        location.href = "{:U('Member/excel')}";
    })
    $("#xx-btn-excel-to").click(function(){
        location.href = "{:U('Member/importExcel')}";
    })

</script>

</html>
